<html>
<head>
    <meta name="layout" content="freshmade">
</head>

<body>

<div id="content-wrapper">
    <div class="center-wrapper">
        <div class="content">
            <div id="main">
                <div class="post">
                    <div class="post-title">
                        <h1><g:message code="company.list"/></h1>
                        <g:render template="/template/messageBar"/>
                    </div>

                    <div class="post-date">
                        <g:render template="/template/listBar1" model="[size: companies.size()]"/>
                    </div>
                </div>

                <table class="data-table">
                    <tr>
                        <th><g:message code="company.name"/></th>
                        <th><g:message code="company.website"/></th>
                        <th><g:message code="company.employees"/></th>
                        <th><g:message code="trace.createdBy"/></th>
                        <th><g:message code="trace.dateCreated"/></th>
                        <th><g:message code="trace.lastUpdatedBy"/></th>
                        <th><g:message code="trace.lastUpdated"/></th>
                    </tr>
                    <tbody>
                    <g:each in="${companies}" status="i" var="c">
                        <tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
                            <td><g:link action="show" id="${c.id}">${c.name}</g:link></td>
                            <td>${c.website}</td>
                            <td>${c.employees.size()}</td>
                            <td>${c.createdBy.name}</td>
                            <td><g:formatDate date="${c.dateCreated}"/></td>
                            <td>${c.lastUpdatedBy.name}</td>
                            <td><g:formatDate date="${c.lastUpdated}"/></td>
                        </tr>
                    </g:each>
                    </tbody>
                </table>

                <div class="pagination">
                    <g:paginate total="${total}"/>
                </div>
            </div>

            <div class="clearer">&nbsp;</div>
        </div>

    </div>
</div>

</body>
</html>